package com.ruoyi.project.express.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.express.order.mapper.ExpressOrderMapper;
import com.ruoyi.project.express.order.domain.ExpressOrder;
import com.ruoyi.project.express.order.service.IExpressOrderService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 物流单号Service业务层处理
 * 
 * @author lindor
 * @date 2020-04-07
 */
@Service
public class ExpressOrderServiceImpl implements IExpressOrderService 
{
    @Autowired
    private ExpressOrderMapper expressOrderMapper;

    /**
     * 查询物流单号
     * 
     * @param orderId 物流单号ID
     * @return 物流单号
     */
    @Override
    public ExpressOrder selectExpressOrderById(Long orderId)
    {
        return expressOrderMapper.selectExpressOrderById(orderId);
    }

    /**
     * 查询物流单号列表
     * 
     * @param expressOrder 物流单号
     * @return 物流单号
     */
    @Override
    public List<ExpressOrder> selectExpressOrderList(ExpressOrder expressOrder)
    {
        return expressOrderMapper.selectExpressOrderList(expressOrder);
    }

    /**
     * 新增物流单号
     * 
     * @param expressOrder 物流单号
     * @return 结果
     */
    @Override
    public int insertExpressOrder(ExpressOrder expressOrder)
    {
        expressOrder.setCreateTime(DateUtils.getNowDate());
        return expressOrderMapper.insertExpressOrder(expressOrder);
    }

    /**
     * 修改物流单号
     * 
     * @param expressOrder 物流单号
     * @return 结果
     */
    @Override
    public int updateExpressOrder(ExpressOrder expressOrder)
    {
        expressOrder.setUpdateTime(DateUtils.getNowDate());
        return expressOrderMapper.updateExpressOrder(expressOrder);
    }

    /**
     * 删除物流单号对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExpressOrderByIds(String ids)
    {
        return expressOrderMapper.deleteExpressOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除物流单号信息
     * 
     * @param orderId 物流单号ID
     * @return 结果
     */
    @Override
    public int deleteExpressOrderById(Long orderId)
    {
        return expressOrderMapper.deleteExpressOrderById(orderId);
    }
}
